<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<h5 style="margin: 8px 39px;color: red;">带 * 号为必填选项</h5>
<form:form commandName="coordinate" cssClass="form-horizontal" role="form">
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="projectName"><span style="color:red;">* </span>企业或项目名称</label>
        <div class="col-sm-4">
            <input type="text" name="projectName" id="projectName" placeholder="企业或项目名称"
                   value="${coordinate.projectName}"
                   class="form-control " required>
        </div>

        <label class="col-sm-2 control-label no-padding-right" for="resDept"><span style="color:red;">* </span>责任单位</label>
        <div class="col-sm-4">
            <input type="text" name="resDept" id="resDept" placeholder="企业或项目的责任单位" value="${coordinate.resDept}"
                   class="form-control " required>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="contact"><span style="color:red;">* </span>责任单位经办人</label>
        <div class="col-sm-4">
            <input type="text" name="contact" id="contact" placeholder="责任单位经办人" value="${coordinate.contact}"
                   class="form-control " required>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="baseInfo">基本情况</label>
        <div class="col-sm-10">
            <textarea rows="2" id="baseInfo" name="baseInfo" placeholder="基本情况"
                      class="form-control ">${coordinate.baseInfo}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="helpInfo"><span style="color:red;">* </span>需协调事项</label>
        <div class="col-sm-10">
            <textarea id="helpInfo" name="helpInfo" rows="5" placeholder="需协调事项" class="form-control "
                      required>${coordinate.helpInfo}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="involveUnits"><span style="color:red;">* </span>涉及部门</label>

        <div class="col-sm-4">
            <select name="involveUnit" id="involveUnits" class="form-control required departments " multiple="multiple" required>
                <optgroup label="">
                    <c:forEach items="${deptLists}" var="deptLists">
                        <option value="${deptLists.branch}">${deptLists.branch}</option>
                    </c:forEach>
                </optgroup>
            </select>
            <%--<input type="text" name="involveUnit" id="involveUnit" placeholder="涉及部门" value="${coordinate.involveUnit}"
                   class="form-control " required>--%>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="organizers"><span style="color:red;">* </span>承办单位</label>
        <div class="col-sm-4">
            <select name="organizer" id="organizers" class="form-control" required>
                <option value="">请选择</option>
                <c:forEach items="${deptLists}" var="deptLists">
                    <option value="${deptLists.branch}">${deptLists.branch}</option>
                </c:forEach>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="boss"><span style="color:red;">* </span>单位负责人</label>
        <div class="col-sm-4">
            <input type="text" name="boss" id="boss" placeholder="单位负责人"
                   value="${coordinate.boss}" class="form-control " required>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="bossPhone"><span style="color:red;">* </span>负责人手机号</label>
        <div class="col-sm-4">
            <input type="text" name="bossPhone" id="bossPhone" placeholder="负责人手机号"
                   value="${coordinate.bossPhone}" class="form-control " required onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="resUser"><span style="color:red;">* </span>单位直接责任人</label>
        <div class="col-sm-4">
            <input type="text" name="resUser" id="resUser" placeholder="单位直接责任人"
                   value="${coordinate.resUser}" class="form-control " required>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="resUserPhone"><span style="color:red;">* </span>责任人手机号</label>
        <div class="col-sm-4">
            <input type="text" name="resUserPhone" id="resUserPhone" placeholder="责任人手机号"
                   value="${coordinate.resUserPhone}" class="form-control " required onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="operator"><span style="color:red;">* </span>单位经办人</label>
        <div class="col-sm-4">
            <input type="text" name="operator" id="operator" placeholder="单位经办人"
                   value="${coordinate.operator}" class="form-control " required>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="operatorPhone"><span style="color:red;">* </span>经办人手机号</label>
        <div class="col-sm-4">
            <input type="text" name="operatorPhone" id="operatorPhone" placeholder="经办人手机号"
                   value="${coordinate.operatorPhone}" class="form-control  " required onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="fGcountyLeader"><span style="color:red;">* </span>分管县领导</label>
        <div class="col-sm-4">
            <input type="text" name="fGcountyLeader" id="fGcountyLeader" placeholder="分管县领导"
                   value="${coordinate.fGcountyLeader}" class="form-control " required>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="fGcountyLeaderPhone"><span style="color:red;">* </span>分管县领导手机号</label>
        <div class="col-sm-4">
            <input type="text" name="fGcountyLeaderPhone" id="fGcountyLeaderPhone" placeholder="分管县领导手机号"
                   value="${coordinate.fGcountyLeaderPhone}" class="form-control " required onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="reportUser"><span style="color:red;">* </span>上报人</label>
        <div class="col-sm-4">
            <input type="text" name="reportUser" id="reportUser" placeholder="上报人"
                   value="${reportUser}" class="form-control " readonly>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="reportUserPhone"><span style="color:red;">* </span>上报人手机号</label>
        <div class="col-sm-4">
            <input type="text" name="reportUserPhone" id="reportUserPhone" placeholder="上报人手机号"
                   value="${coordinate.reportUserPhone}" class="form-control " required onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11>
        </div>
    </div>
    <%--<input type="text" id="sysId" value="${coordinate.sysId}" hidden>--%>
    <form:hidden path="sysId"/>
</form:form>
<hr width="100%;height:2px;">
<div class="row" style="margin-left: 40px;">
    * 以上按住如此标志：<img src="/assets/web/img/zzc.png"  alt="提示" />可拖动调整相应输入框大小
</div>
<script>
  $(function () {
      //涉及部门
      $(".departments").change(function () {
          var selectedArr = $(".fs-label").text().split(",");//获取已选择部门
          var html="";
          for(var i =0;i<selectedArr.length;i++){
              html+='\
            <option value="'+selectedArr[i]+'">'+selectedArr[i]+'</option>\
            ';
          }
          //承办单位需从已选涉及部门中选择
          $("#organizers").html(html);

      });
      $('.departments').fSelect();
  })
</script>
